package com.ty.day3;

import java.util.Random;

/**
 * Created by IntelliJ IDEA.
 *
 * @author : txy
 * @create : 2023/11/16 17:07
 */
public class ArrayDemo {
    public static void main(String[] args) {
        Point[][] points = new Point[4][4];
        Random random = new Random();
        for (int i = 0; i < points.length; i++) {

            for (int j = 0; j < points[i].length; j++) {
                Point point = new Point();
                point.setX(random.nextInt(20));
                point.setY(random.nextInt(20));
                points[i][j] = point;
            }
        }
        Double sum = 0.0;
        for (int i = 0; i < points.length; i++) {
            for (int j = 0; j < points[i].length; j++) {
                points[i][j].point();
                sum += points[i][j].getX() * points[i][j].getY();
            }
        }
        System.out.println(sum);
    }
}
